package com.example.mapper;

import com.example.entity.ZyzComment;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

public interface ZyzCommentMapper {

    /**
     * 根据学生id和活动id查询评论
     * @param zyzComment
     * @return
     */
    @Select("select * from zyz_comment where student_id = #{studentId} and activity_id = #{activityId}")
    ZyzComment selectStudentIdAndActivityId(ZyzComment zyzComment);

    /**
     * 添加评论
     * @param zyzComment
     * @return
     */
    int insert(ZyzComment zyzComment);

    /**
     * 批量删除
     * @param
     * @return
     */
    int deleteBatch(String[] ids);

    /**
     * 修改
     * @param zyzComment
     * @return
     */
    int updateById(ZyzComment zyzComment);

    /**
     * 查询所有
     */
    List<Map<String, Object>> selectAll(ZyzComment zyzComment);

    @Select("select count(*) from zyz_comment where activity_id = #{id}")
    Integer selectCount(Integer id);
}
